var winnerPromise = new Promise((resolve) => {
    setTimeout(() => {
        console.log('log ----- this is winner')
        resolve('this is winner')
    }, 4);
})
var loserPromise = new Promise((resolve) => {
    setTimeout(() => {
        console.log('log ----- this is loser')
        resolve('this is loser')
    }, 1000);
})
Promise.race([winnerPromise, loserPromise]).then(function(value) {
    console.log(value)
})